package v1

import "pq/service"

var areaService = service.AreaService{}

type AreaController struct {
	BaseController
}

func (ac *AreaController) ListProvince() {
	provinces := areaService.GetProvince()
	ac.Response(provinces,len(provinces))
}

func (ac *AreaController) ListCity() {
	code := ac.GetString("area_code")
	city := areaService.GetCity(code)
	ac.Response(city,len(city))
}

func (ac *AreaController) ListAll() {
	tree := areaService.GetAll()
	ac.Response(tree,len(tree))
}
